<template>
    <div>
    <MyHeader bgColor="#78bb7b" fontColor="skyblue" title="购物车"/>
    <div class="list" style="padding:45px 0 50px">
    <MyGoods v-for="obj in list" :key="obj.id" :goodsObj="obj"/>
    </div>
    <MyFooter/>
    </div>
</template>

<script>
import MyHeader from './components/MyHeader.vue'
import MyGoods from './components/MyGoods.vue'
import MyFooter from './components/MyFooter.vue'
export default {
    components:{
        MyHeader,
        MyGoods,
        MyFooter,
    },
    data(){
        return {
            list:[],
        }
    },
    async created(){
        let resp=await this.$http({
            method:'get',
            url:'/api/cart'
        })
        // console.log(resp.data);
        this.list=resp.data.list
        // console.log(this.list);
    }

}
</script>

<style>

</style>